package com.pai4j.remote.pgc.community;

import com.pai4j.common.bean.PAIPageResponseBeanUtil;
import com.pai4j.common.bean.PAIResponseBean;
import com.pai4j.domain.community.vo.request.CCPathSaveRequestVO;
import com.pai4j.domain.community.vo.response.cc.CTCPathBaseVO;
import com.pai4j.domain.community.vo.response.cc.CTCPathDetailVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * community Path (栏目) Feign Client
 * 提供社区栏目相关的远程调用接口
 *
 * @author: CYM-pai
 * @date: 2025/10/28
 **/
@FeignClient(name = "pai4j-pgc-service", contextId = "ccPathClient")
public interface CCPathClient {

    /**
     * 初始化栏目管理员
     */
    @GetMapping("/pgc-service/api/cc/path/initAdmin")
    PAIResponseBean<String> initPathAdmin();

    /**
     * 保存/编辑栏目
     */
    @PostMapping("/pgc-service/api/cc/path/save")
    PAIResponseBean<Long> save(@RequestBody CCPathSaveRequestVO pathSaveRequest);

    /**
     * 获取推荐栏目列表
     */
    @GetMapping("/pgc-service/api/cc/path/recommends")
    PAIResponseBean<List<CTCPathBaseVO>> recommends();

    /**
     * 获取用户订阅的栏目列表
     */
    @GetMapping("/pgc-service/api/cc/path/subscribes")
    PAIResponseBean<List<CTCPathBaseVO>> subscribes();

    /**
     * 获取最新栏目列表
     */
    @GetMapping("/pgc-service/api/cc/path/new/list")
    PAIResponseBean<List<CTCPathDetailVO>> getNewList();

    /**
     * 获取用户关注的栏目列表
     */
    @GetMapping("/pgc-service/api/cc/path/attend/list")
    PAIResponseBean<List<CTCPathDetailVO>> getUserAttendPathList(
            @RequestParam(value = "size", defaultValue = "100") Integer size);

    /**
     * 更新栏目状态
     */
    @PostMapping("/pgc-service/api/cc/path/updateStatus/{pathId}/{status}")
    PAIResponseBean<Long> updateStatus(@PathVariable("pathId") Long pathId, 
                                       @PathVariable("status") String status);

    /**
     * 更新栏目付费订阅金额
     */
    @PostMapping("/pgc-service/api/cc/path/updatePaidSubMoney/{pathId}/{money}")
    PAIResponseBean<Long> updatePaidSubMoney(@PathVariable("pathId") Long pathId, 
                                             @PathVariable("money") Integer money);

    /**
     * 推荐栏目
     */
    @PostMapping("/pgc-service/api/cc/path/recommend/{pathId}")
    PAIResponseBean<Long> recommend(@PathVariable("pathId") Long pathId);

    /**
     * 取消推荐栏目
     */
    @PostMapping("/pgc-service/api/cc/path/cancelRecommend/{pathId}")
    PAIResponseBean<Long> cancelRecommend(@PathVariable("pathId") Long pathId);

    /**
     * 分页查询栏目列表
     */
    @GetMapping("/pgc-service/api/cc/path/page")
    PAIPageResponseBeanUtil<List<CTCPathBaseVO>> page(
            @RequestParam(value = "name", required = false) String name,
            @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
            @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    /**
     * 获取栏目推荐列表（Feed流）
     */
    @GetMapping("/pgc-service/api/cc/path/feed")
    PAIResponseBean<List<CTCPathBaseVO>> feed(
            @RequestParam(value = "size", defaultValue = "8") Integer size);
}

